Skip to content

refactor: remove unnecessary ReactElement type annotations in components#40821

Merged
ggazzo merged 1 commit into
developfrom
refactor/prepare-types-for-react-19-19
Jun 9, 2026
Merged

refactor: remove unnecessary ReactElement type annotations in components#40821
ggazzo merged 1 commit into
developfrom
refactor/prepare-types-for-react-19-19

Conversation

@tassoevan

@tassoevan tassoevan commented Jun 4, 2026

Copy link
Copy Markdown
Member

⚠️ This is part 19/23 of #40796. PR for refactor/prepare-types-for-react-19-15 must be merged first.


Proposed changes (including videos or screenshots)

As a first step towards upgrading to React 19, it handles types from @types/react looking forward the next major.

Issue(s)

Task: ARCH-2170

Steps to test or reproduce

Further comments

No runtime change is expected from it.

@changeset-bot

changeset-bot Bot commented Jun 4, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 09076e7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 196 files, which is 46 over the limit of 150.

To get a review, narrow the scope:
• coderabbit review --type committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0afcd71f-b7cc-4a06-8d4f-18bfef42ca50

📥 Commits

Reviewing files that changed from the base of the PR and between f4f3612 and 09076e7.

📒 Files selected for processing (196)
  • apps/meteor/client/hooks/useResizeInlineBreakpoint.ts
  • apps/meteor/client/views/account/AccountRouter.tsx
  • apps/meteor/client/views/account/deviceManagement/DeviceManagementAccountPage.tsx
  • apps/meteor/client/views/account/deviceManagement/DeviceManagementAccountTable/DeviceManagementAccountRow.tsx
  • apps/meteor/client/views/account/deviceManagement/DeviceManagementAccountTable/DeviceManagementAccountTable.tsx
  • apps/meteor/client/views/account/integrations/AccountIntegrationsRoute.tsx
  • apps/meteor/client/views/account/omnichannel/OmnichannelPreferencesPage.tsx
  • apps/meteor/client/views/account/omnichannel/PreferencesGeneral.tsx
  • apps/meteor/client/views/account/preferences/AccountPreferencesPage.tsx
  • apps/meteor/client/views/account/profile/AccountProfileForm.tsx
  • apps/meteor/client/views/account/profile/AccountProfilePage.tsx
  • apps/meteor/client/views/account/profile/AccountProfileRoute.tsx
  • apps/meteor/client/views/account/security/AccountSecurityPage.tsx
  • apps/meteor/client/views/account/security/AccountSecurityRoute.tsx
  • apps/meteor/client/views/account/security/ChangePassphrase.tsx
  • apps/meteor/client/views/account/security/EndToEnd.tsx
  • apps/meteor/client/views/account/security/ResetPassphrase.tsx
  • apps/meteor/client/views/account/security/TwoFactorTOTP.tsx
  • apps/meteor/client/views/account/tokens/AccountTokensPage.tsx
  • apps/meteor/client/views/account/tokens/AccountTokensRoute.tsx
  • apps/meteor/client/views/account/tokens/AccountTokensTable/AccountTokensTable.tsx
  • apps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingField.tsx
  • apps/meteor/client/views/admin/ABAC/AdminABACRoute.tsx
  • apps/meteor/client/views/admin/AdministrationRouter.tsx
  • apps/meteor/client/views/admin/customEmoji/AddCustomEmoji.tsx
  • apps/meteor/client/views/admin/customEmoji/CustomEmojiRoute.tsx
  • apps/meteor/client/views/admin/customSounds/AddCustomSound.tsx
  • apps/meteor/client/views/admin/customSounds/CustomSoundsRoute.tsx
  • apps/meteor/client/views/admin/customSounds/CustomSoundsTable/CustomSoundRow.tsx
  • apps/meteor/client/views/admin/customSounds/EditCustomSound.tsx
  • apps/meteor/client/views/admin/customSounds/EditSound.tsx
  • apps/meteor/client/views/admin/customUserStatus/CustomUserStatusForm.tsx
  • apps/meteor/client/views/admin/customUserStatus/CustomUserStatusFormWithData.tsx
  • apps/meteor/client/views/admin/customUserStatus/CustomUserStatusRoute.tsx
  • apps/meteor/client/views/admin/customUserStatus/CustomUserStatusTable/CustomUserStatusRow.tsx
  • apps/meteor/client/views/admin/customUserStatus/CustomUserStatusTable/CustomUserStatusTable.tsx
  • apps/meteor/client/views/admin/deviceManagement/DeviceManagementAdminRoute.tsx
  • apps/meteor/client/views/admin/deviceManagement/DeviceManagementInfo/DeviceManagementInfo.tsx
  • apps/meteor/client/views/admin/emailInbox/EmailInboxForm.tsx
  • apps/meteor/client/views/admin/emailInbox/EmailInboxFormWithData.tsx
  • apps/meteor/client/views/admin/emailInbox/EmailInboxPage.tsx
  • apps/meteor/client/views/admin/emailInbox/EmailInboxRoute.tsx
  • apps/meteor/client/views/admin/emailInbox/EmailInboxTable.tsx
  • apps/meteor/client/views/admin/emailInbox/SendTestButton.tsx
  • apps/meteor/client/views/admin/engagementDashboard/EngagementDashboardCard.tsx
  • apps/meteor/client/views/admin/engagementDashboard/EngagementDashboardCardErrorBoundary.tsx
  • apps/meteor/client/views/admin/engagementDashboard/EngagementDashboardCardFilter.tsx
  • apps/meteor/client/views/admin/engagementDashboard/EngagementDashboardPage.stories.tsx
  • apps/meteor/client/views/admin/engagementDashboard/EngagementDashboardPage.tsx
  • apps/meteor/client/views/admin/engagementDashboard/EngagementDashboardRoute.tsx
  • apps/meteor/client/views/admin/engagementDashboard/channels/ChannelsOverview.tsx
  • apps/meteor/client/views/admin/engagementDashboard/channels/ChannelsTab.tsx
  • apps/meteor/client/views/admin/engagementDashboard/dataView/LegendSymbol.stories.tsx
  • apps/meteor/client/views/admin/engagementDashboard/dataView/LegendSymbol.tsx
  • apps/meteor/client/views/admin/engagementDashboard/messages/MessagesPerChannelSection.tsx
  • apps/meteor/client/views/admin/engagementDashboard/messages/MessagesSentSection.tsx
  • apps/meteor/client/views/admin/engagementDashboard/messages/MessagesTab.tsx
  • apps/meteor/client/views/admin/engagementDashboard/users/ActiveUsersSection.tsx
  • apps/meteor/client/views/admin/engagementDashboard/users/BusiestChatTimesSection.tsx
  • apps/meteor/client/views/admin/engagementDashboard/users/ContentForDays.tsx
  • apps/meteor/client/views/admin/engagementDashboard/users/ContentForHours.tsx
  • apps/meteor/client/views/admin/engagementDashboard/users/NewUsersSection.tsx
  • apps/meteor/client/views/admin/engagementDashboard/users/UsersByTimeOfTheDaySection.tsx
  • apps/meteor/client/views/admin/engagementDashboard/users/UsersTab.stories.tsx
  • apps/meteor/client/views/admin/engagementDashboard/users/UsersTab.tsx
  • apps/meteor/client/views/admin/featurePreview/AdminFeaturePreviewRoute.tsx
  • apps/meteor/client/views/admin/integrations/IntegrationsPage.tsx
  • apps/meteor/client/views/admin/invites/InviteRow.tsx
  • apps/meteor/client/views/admin/invites/InvitesPage.tsx
  • apps/meteor/client/views/admin/invites/InvitesRoute.tsx
  • apps/meteor/client/views/admin/moderation/MessageReportInfo.tsx
  • apps/meteor/client/views/admin/moderation/ModerationConsoleActions.tsx
  • apps/meteor/client/views/admin/moderation/ModerationConsoleTableRow.tsx
  • apps/meteor/client/views/admin/moderation/UserReports/ModConsoleUserTableRow.tsx
  • apps/meteor/client/views/admin/moderation/helpers/ContextMessage.tsx
  • apps/meteor/client/views/admin/moderation/helpers/ReportReason.tsx
  • apps/meteor/client/views/admin/oauthApps/EditOauthApp.tsx
  • apps/meteor/client/views/admin/oauthApps/EditOauthAppWithData.tsx
  • apps/meteor/client/views/admin/oauthApps/OAuthAddApp.tsx
  • apps/meteor/client/views/admin/oauthApps/OAuthAppsPage.tsx
  • apps/meteor/client/views/admin/oauthApps/OAuthAppsRoute.tsx
  • apps/meteor/client/views/admin/oauthApps/OAuthAppsTable.tsx
  • apps/meteor/client/views/admin/permissions/EditRolePage.tsx
  • apps/meteor/client/views/admin/permissions/EditRolePageWithData.tsx
  • apps/meteor/client/views/admin/permissions/PermissionsContextBar.tsx
  • apps/meteor/client/views/admin/permissions/PermissionsPage.tsx
  • apps/meteor/client/views/admin/permissions/PermissionsRouter.tsx
  • apps/meteor/client/views/admin/permissions/PermissionsTable/PermissionRow.tsx
  • apps/meteor/client/views/admin/permissions/PermissionsTable/PermissionsTableFilter.tsx
  • apps/meteor/client/views/admin/permissions/PermissionsTable/RoleCell.tsx
  • apps/meteor/client/views/admin/permissions/PermissionsTable/RoleHeader.tsx
  • apps/meteor/client/views/admin/permissions/UsersInRole/UsersInRolePage.tsx
  • apps/meteor/client/views/admin/permissions/UsersInRole/UsersInRolePageWithData.tsx
  • apps/meteor/client/views/admin/permissions/UsersInRole/UsersInRoleTable/UsersInRoleTableRow.tsx
  • apps/meteor/client/views/admin/rooms/RoomsPage.tsx
  • apps/meteor/client/views/admin/rooms/RoomsRoute.tsx
  • apps/meteor/client/views/admin/rooms/RoomsTable.tsx
  • apps/meteor/client/views/admin/rooms/RoomsTableFilters.tsx
  • apps/meteor/client/views/admin/settings/Setting/MemoizedSetting.tsx
  • apps/meteor/client/views/admin/settings/Setting/ResetSettingButton/ResetSettingButton.tsx
  • apps/meteor/client/views/admin/settings/Setting/Setting.tsx
  • apps/meteor/client/views/admin/settings/Setting/SettingSkeleton.tsx
  • apps/meteor/client/views/admin/settings/Setting/inputs/ActionInputBase.tsx
  • apps/meteor/client/views/admin/settings/Setting/inputs/ActionSettingInput.tsx
  • apps/meteor/client/views/admin/settings/Setting/inputs/AssetSettingInput.tsx
  • apps/meteor/client/views/admin/settings/Setting/inputs/BooleanSettingInput.tsx
  • apps/meteor/client/views/admin/settings/Setting/inputs/CodeMirror/CodeMirror.tsx
  • apps/meteor/client/views/admin/settings/Setting/inputs/CodeMirror/CodeMirrorBox.tsx
  • apps/meteor/client/views/admin/settings/Setting/inputs/CodeSettingInput.tsx
  • apps/meteor/client/views/admin/settings/Setting/inputs/ColorSettingInput.tsx
  • apps/meteor/client/views/admin/settings/Setting/inputs/FontSettingInput.tsx
  • apps/meteor/client/views/admin/settings/Setting/inputs/GenericSettingInput.tsx
  • apps/meteor/client/views/admin/settings/Setting/inputs/IntSettingInput.tsx
  • apps/meteor/client/views/admin/settings/Setting/inputs/LanguageSettingInput.tsx
  • apps/meteor/client/views/admin/settings/Setting/inputs/LookupSettingInput.tsx
  • apps/meteor/client/views/admin/settings/Setting/inputs/MultiSelectSettingInput.tsx
  • apps/meteor/client/views/admin/settings/Setting/inputs/PasswordSettingInput.tsx
  • apps/meteor/client/views/admin/settings/Setting/inputs/RangeSettingInput.tsx
  • apps/meteor/client/views/admin/settings/Setting/inputs/RelativeUrlSettingInput.tsx
  • apps/meteor/client/views/admin/settings/Setting/inputs/RoomPickSettingInput.tsx
  • apps/meteor/client/views/admin/settings/Setting/inputs/SelectSettingInput.tsx
  • apps/meteor/client/views/admin/settings/Setting/inputs/SelectTimezoneSettingInput.tsx
  • apps/meteor/client/views/admin/settings/Setting/inputs/StringSettingInput.tsx
  • apps/meteor/client/views/admin/settings/Setting/inputs/TimespanSettingInput.tsx
  • apps/meteor/client/views/admin/settings/SettingsGroupCard.tsx
  • apps/meteor/client/views/admin/settings/SettingsPage.tsx
  • apps/meteor/client/views/admin/settings/SettingsRoute.tsx
  • apps/meteor/client/views/admin/settings/SettingsSection/SettingsSection.tsx
  • apps/meteor/client/views/admin/settings/SettingsSection/SettingsSectionSkeleton.tsx
  • apps/meteor/client/views/admin/settings/groups/BaseGroupPage.tsx
  • apps/meteor/client/views/admin/settings/groups/GenericGroupPage.tsx
  • apps/meteor/client/views/admin/settings/groups/OAuthGroupPage/CreateOAuthModal.tsx
  • apps/meteor/client/views/admin/settings/groups/OAuthGroupPage/OAuthGroupPage.tsx
  • apps/meteor/client/views/admin/settings/groups/TabbedGroupPage.tsx
  • apps/meteor/client/views/admin/subscription/SubscriptionRoute.tsx
  • apps/meteor/client/views/admin/subscription/components/FeatureUsageCard.tsx
  • apps/meteor/client/views/admin/subscription/components/InfoTextIconModal.tsx
  • apps/meteor/client/views/admin/subscription/components/UpgradeButton.tsx
  • apps/meteor/client/views/admin/subscription/components/UsagePieGraph.tsx
  • apps/meteor/client/views/admin/subscription/components/cards/ActiveSessionsCard.tsx
  • apps/meteor/client/views/admin/subscription/components/cards/ActiveSessionsPeakCard.tsx
  • apps/meteor/client/views/admin/subscription/components/cards/AppsUsageCard/AppsUsageCard.tsx
  • apps/meteor/client/views/admin/subscription/components/cards/CountMACCard.tsx
  • apps/meteor/client/views/admin/subscription/components/cards/CountSeatsCard.tsx
  • apps/meteor/client/views/admin/subscription/components/cards/FeaturesCard.tsx
  • apps/meteor/client/views/admin/subscription/components/cards/MACCard.tsx
  • apps/meteor/client/views/admin/subscription/components/cards/PlanCard.tsx
  • apps/meteor/client/views/admin/subscription/components/cards/PlanCard/PlanCardCommunity.tsx
  • apps/meteor/client/views/admin/subscription/components/cards/PlanCard/PlanCardHeader.tsx
  • apps/meteor/client/views/admin/subscription/components/cards/PlanCard/PlanCardPremium.tsx
  • apps/meteor/client/views/admin/subscription/components/cards/PlanCard/PlanCardTrial.tsx
  • apps/meteor/client/views/admin/subscription/components/cards/SeatsCard.tsx
  • apps/meteor/client/views/admin/subscription/surface/UiKitSubscriptionLicense.tsx
  • apps/meteor/client/views/admin/subscription/surface/UiKitSubscriptionLicenseSurface.tsx
  • apps/meteor/client/views/admin/users/AdminUserFormWithData.tsx
  • apps/meteor/client/views/admin/users/AdminUserInfoActions.tsx
  • apps/meteor/client/views/admin/users/AdminUserInfoWithData.tsx
  • apps/meteor/client/views/admin/users/AdminUsersPage.tsx
  • apps/meteor/client/views/admin/users/AdminUsersRoute.tsx
  • apps/meteor/client/views/admin/users/SeatsCapUsage/SeatsCapUsage.stories.tsx
  • apps/meteor/client/views/admin/users/SeatsCapUsage/SeatsCapUsage.tsx
  • apps/meteor/client/views/admin/users/UsersTable/UsersTable.tsx
  • apps/meteor/client/views/admin/users/UsersTable/UsersTableRow.tsx
  • apps/meteor/client/views/admin/viewLogs/ViewLogsPage.stories.tsx
  • apps/meteor/client/views/admin/viewLogs/ViewLogsPage.tsx
  • apps/meteor/client/views/admin/viewLogs/ViewLogsRoute.tsx
  • apps/meteor/client/views/admin/workspace/DeploymentCard/DeploymentCard.tsx
  • apps/meteor/client/views/admin/workspace/MessagesRoomsCard/MessagesRoomsCard.tsx
  • apps/meteor/client/views/admin/workspace/UsersUploadsCard/UsersUploadsCard.tsx
  • apps/meteor/client/views/admin/workspace/VersionCard/VersionCard.tsx
  • apps/meteor/client/views/admin/workspace/VersionCard/components/VersionCardActionButton.tsx
  • apps/meteor/client/views/admin/workspace/VersionCard/components/VersionCardActionItem.tsx
  • apps/meteor/client/views/admin/workspace/WorkspaceRoute.tsx
  • apps/meteor/client/views/audit/AuditLogPage.tsx
  • apps/meteor/client/views/audit/SecurityLogsPage.tsx
  • apps/meteor/client/views/audit/components/AuditFiltersDisplay.tsx
  • apps/meteor/client/views/audit/components/AuditLogEntry.tsx
  • apps/meteor/client/views/audit/components/AuditLogTable.tsx
  • apps/meteor/client/views/audit/components/AuditMessageList.tsx
  • apps/meteor/client/views/audit/components/AuditResult.tsx
  • apps/meteor/client/views/audit/components/SecurityLogsTable.tsx
  • apps/meteor/client/views/audit/components/forms/DateRangePicker.tsx
  • apps/meteor/client/views/audit/components/forms/VisitorAutoComplete.tsx
  • apps/meteor/client/views/audit/components/tabs/DirectTab.tsx
  • apps/meteor/client/views/audit/components/tabs/OmnichannelTab.tsx
  • apps/meteor/client/views/audit/components/tabs/UsersTab.tsx
  • apps/meteor/client/views/banners/BannerRegion.tsx
  • apps/meteor/client/views/banners/UiKitBanner.tsx
  • apps/meteor/client/views/composer/AudioMessageRecorder/AudioMessageRecorder.tsx
  • apps/meteor/client/views/composer/EmojiPicker/EmojiPicker.tsx
  • apps/meteor/client/views/composer/EmojiPicker/EmojiPickerDesktopDropdown.tsx
  • apps/meteor/client/views/composer/EmojiPicker/EmojiPickerDropDown.tsx
  • apps/meteor/client/views/composer/EmojiPicker/ToneSelector/ToneSelector.tsx
  • apps/meteor/client/views/composer/VideoMessageRecorder/VideoMessageRecorder.tsx
  • apps/meteor/client/views/conference/ConferencePage.tsx
  • apps/meteor/client/views/conference/ConferenceRoute.tsx

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dionisio-bot

dionisio-bot Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.66667% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.08%. Comparing base (f4f3612) to head (09076e7).
⚠️ Report is 3 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #40821      +/-   ##
===========================================
- Coverage    70.16%   70.08%   -0.08%     
===========================================
  Files         3342     3340       -2     
  Lines       123685   123562     -123     
  Branches     22077    22083       +6     
===========================================
- Hits         86778    86601     -177     
- Misses       33561    33613      +52     
- Partials      3346     3348       +2     
Flag Coverage Δ
unit 70.93% <71.66%> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tassoevan tassoevan force-pushed the refactor/prepare-types-for-react-19-19 branch from be9e153 to d91224d Compare June 9, 2026 16:21
@tassoevan tassoevan added this to the 8.6.0 milestone Jun 9, 2026
@tassoevan tassoevan added the stat: QA assured Means it has been tested and approved by a company insider label Jun 9, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Jun 9, 2026
- Updated multiple components to remove explicit ReactElement return type annotations, simplifying the code.
- Adjusted function signatures in various files to use implicit return types instead.
- Improved consistency across the codebase by standardizing function definitions.
@tassoevan tassoevan force-pushed the refactor/prepare-types-for-react-19-19 branch from d91224d to 09076e7 Compare June 9, 2026 16:22
@tassoevan tassoevan marked this pull request as ready for review June 9, 2026 16:23
@tassoevan tassoevan requested a review from a team as a code owner June 9, 2026 16:23

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 196 files

Note: This PR contains a large number of files. cubic only reviews up to 100 files per PR, so some files may not have been reviewed. cubic prioritizes the most important files to review.
On a pro plan you can use ultrareview for larger PRs.

Re-trigger cubic

@ggazzo ggazzo merged commit 1b88937 into develop Jun 9, 2026
18 checks passed
@ggazzo ggazzo deleted the refactor/prepare-types-for-react-19-19 branch June 9, 2026 16:42

@hacktron-app hacktron-app Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Severity Count
HIGH 1

View full scan results

};

const ConferencePage = (): ReactElement => {
const ConferencePage = () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HIGH DOM-based Cross-Site Scripting (XSS) and Open Redirect via callUrl Parameter in ConferencePage

The ConferencePage component is vulnerable to DOM-based Cross-Site Scripting (XSS) and Open Redirect because it retrieves the callUrl parameter directly from the URL query string without validation or sanitization, and subsequently passes it to window.open().

Specifically, getQueryParams extracts callUrl from window.location.search. This value is passed into useVideoConfOpenCall, which invokes window.open(callUrl). If an attacker crafts a link containing a javascript: protocol (e.g., javascript:alert(document.cookie)//), the browser will execute the arbitrary JavaScript payload in the context of the Rocket.Chat application origin when the victim visits the page. Alternatively, an attacker can supply an external malicious URL to perform an Open Redirect attack.

This vulnerability also transitively affects the Outlook Calendar integration (OutlookCalendarEventModal.tsx), where a malicious meetingUrl synced from a calendar event is passed to useVideoConfOpenCall and opened without validation.

Steps to Reproduce
  1. As an attacker, craft a malicious link targeting the Rocket.Chat instance:
    https://<your-rocketchat-domain>/conference?callUrl=javascript:alert(document.domain)//
  2. Send this link to an authenticated Rocket.Chat user.
  3. Once the user clicks the link, the ConferencePage component loads, retrieves the callUrl parameter, appends user details, and executes window.open('javascript:alert(document.domain)//&name=...').
  4. The JavaScript payload executes, displaying an alert with the application's domain.
Trace
graph TD
    subgraph SG0 ["apps/meteor/client/components/LoadingIndicator.tsx"]
        LoadingIndicator["Displays a loading animation with configurable size variation."]
    end
    style SG0 fill:#2a2a2a,stroke:#444,color:#aaa
    subgraph SG1 ["apps/meteor/client/views/conference/ConferencePage.tsx"]
        getQueryParams["getQueryParams"]
        ConferencePage{{"Component that handles the video conference page routing and call initialization."}}
    end
    style SG1 fill:#2a2a2a,stroke:#444,color:#aaa
    subgraph SG2 ["apps/meteor/client/views/conference/ConferencePageError.tsx"]
        ConferencePageError["Error state component for the video conference page."]
    end
    style SG2 fill:#2a2a2a,stroke:#444,color:#aaa
    subgraph SG3 ["apps/meteor/client/views/conference/ConferenceRoute.tsx"]
        ConferenceRoute["Route component that enforces authentication for video conferences."]
    end
    style SG3 fill:#2a2a2a,stroke:#444,color:#aaa
    subgraph SG4 ["apps/meteor/client/views/room/contextualBar/VideoConference/VideoConfBlockModal.tsx"]
        VideoConfBlockModal["Modal component shown when a browser blocks a video conference call popup."]
    end
    style SG4 fill:#2a2a2a,stroke:#444,color:#aaa
    subgraph SG5 ["apps/meteor/client/views/room/contextualBar/VideoConference/hooks/useVideoConfOpenCall.tsx"]
        useVideoConfOpenCall["Hook to open a video conference call, handling browser popup blocking."]
        open["Internal function to open a URL in a new window."]
    end
    style SG5 fill:#2a2a2a,stroke:#444,color:#aaa
    subgraph SG6 ["apps/meteor/client/views/root/PageLoading.tsx"]
        PageLoading["Displays a loading spinner or indicator while a page is loading."]
    end
    style SG6 fill:#2a2a2a,stroke:#444,color:#aaa
    ConferencePage --> ConferencePageError
    ConferencePage --> useVideoConfOpenCall
    ConferencePage --> PageLoading
    ConferencePage --> getQueryParams
    useVideoConfOpenCall --> open
    useVideoConfOpenCall --> VideoConfBlockModal
    PageLoading --> LoadingIndicator
    open --> open
    ConferenceRoute --> ConferencePage
Loading
Fix with AI

Open in Cursor Open in Claude

A security vulnerability was found by Hacktron.

File: apps/meteor/client/views/conference/ConferencePage.tsx
Lines: 17
Severity: high

Vulnerability: DOM-based Cross-Site Scripting (XSS) and Open Redirect via callUrl Parameter in ConferencePage

Description:
The `ConferencePage` component is vulnerable to DOM-based Cross-Site Scripting (XSS) and Open Redirect because it retrieves the `callUrl` parameter directly from the URL query string without validation or sanitization, and subsequently passes it to `window.open()`.

Specifically, `getQueryParams` extracts `callUrl` from `window.location.search`. This value is passed into `useVideoConfOpenCall`, which invokes `window.open(callUrl)`. If an attacker crafts a link containing a `javascript:` protocol (e.g., `javascript:alert(document.cookie)//`), the browser will execute the arbitrary JavaScript payload in the context of the Rocket.Chat application origin when the victim visits the page. Alternatively, an attacker can supply an external malicious URL to perform an Open Redirect attack.

This vulnerability also transitively affects the Outlook Calendar integration (`OutlookCalendarEventModal.tsx`), where a malicious `meetingUrl` synced from a calendar event is passed to `useVideoConfOpenCall` and opened without validation.

Proof of Concept:
1. As an attacker, craft a malicious link targeting the Rocket.Chat instance:
   `https://<your-rocketchat-domain>/conference?callUrl=javascript:alert(document.domain)//`
2. Send this link to an authenticated Rocket.Chat user.
3. Once the user clicks the link, the `ConferencePage` component loads, retrieves the `callUrl` parameter, appends user details, and executes `window.open('javascript:alert(document.domain)//&name=...')`.
4. The JavaScript payload executes, displaying an alert with the application's domain.

Affected Code:
- [Rocket.Chat/apps/meteor/client/views/conference/ConferencePage.tsx:9-15](https://github.com/RocketChat/Rocket.Chat/blob/master/apps/meteor/client/views/conference/ConferencePage.tsx#L9-L15)
```typescript
const getQueryParams = () => {
	const queryString = window.location.search;
	const urlParams = new URLSearchParams(queryString);
	const callUrlParam = urlParams.get('callUrl');

	return { callUrlParam };
};
```
- [Rocket.Chat/apps/meteor/client/views/conference/ConferencePage.tsx:24-25](https://github.com/RocketChat/Rocket.Chat/blob/master/apps/meteor/client/views/conference/ConferencePage.tsx#L24-L25)
```typescript
	const { callUrlParam } = getQueryParams();
	const callUrl = callUrlParam && userDisplayName ? `${callUrlParam}&name=${userDisplayName}` : callUrlParam;
```
- [Rocket.Chat/apps/meteor/client/views/conference/ConferencePage.tsx:32](https://github.com/RocketChat/Rocket.Chat/blob/master/apps/meteor/client/views/conference/ConferencePage.tsx#L32)
```typescript
		handleOpenCall(callUrl);
```
- [Rocket.Chat/apps/meteor/client/views/room/contextualBar/VideoConference/hooks/useVideoConfOpenCall.tsx:14-15](https://github.com/RocketChat/Rocket.Chat/blob/master/apps/meteor/client/views/room/contextualBar/VideoConference/hooks/useVideoConfOpenCall.tsx#L14-L15)
```typescript
				const open = () => window.open(callUrl);
				const popup = open();
```

Acceptance criteria:
- Acceptance is defined by the **actual reported behavior**, not by tests passing.
- Reproduce the issue, or narrow the exact code path that produces it, *before* changing code. State what you confirmed.
- Fix the underlying cause. Mitigations that paper over the reported behavior do not count as a fix.
- Add a regression test that fails on the unpatched code and passes on the fix. If a regression test is genuinely impractical (e.g. race condition, infra-level issue), say so and explain why.
- Existing tests passing is **not** the bar. Do not declare done on tests-pass theatre.

Only change what is necessary to fix this vulnerability. Do not refactor adjacent code or modify unrelated files.

Triage: Reply !fp <reason> (false positive), !valid (confirmed), or !accepted_risk <reason>. Any other reply is saved as a triage note.
Reason is optional but improves future scans — e.g. !fp internal endpoint, not user-facing.

View finding in Hacktron

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants